#-*- coding: utf-8 -*-
import gvars

#场景

def CreateScene(iSceneSID):
	import scene
	classobj=scene.Modules[iSceneSID].CScene
	scobj=classobj()
	if iSceneSID in gvars.Scene:
		raise Exception("ReCreate Scene(%d)"%iSceneSID)
	gvars.Scene[iSceneSID]=scobj
	return scobj

def GetScene(iSceneSID):
	if iSceneSID in gvars.Scene:
		return gvars.Scene[iSceneSID]
	return None

def DelScene(iSceneSID):
	if iSceneSID in gvars.Scene:
		del gvars.Scene[iSceneSID]

#菜单

def CreateMenu(iMenuSID):
	import menu
	classobj=menu.Modules[iMenuSID].CMenu
	iMenuID=gvars.NewMenuID()
	menuobj=classobj(iMenuID)
	gvars.Menu[iMenuID]=menuobj
	return menuobj

def GetMenu(iMenuID):
	if iMenuID in gvars.Menu:
		return gvars.Menu[iMenuID]
	return None

def DelMenu(iMenuID):
	if iMenuID in gvars.Menu:
		del gvars.Menu[iMenuID]


#动画元件

def CreateAni(iAniSID):
	import ani
	classobj=ani.Modules[iAniSID].CAni
	iAniID=gvars.NewAniID()
	aniobj=classobj(iAniID)
	gvars.Ani[iAniID]=aniobj
	return aniobj

def GetAni(iAniID):
	if iAniID in gvars.Ani:
		return gvars.Ani[iAniID]
	return None

def DelAni(iAniID):
	if iAniID in gvars.Ani:
		del gvars.Ani[iAniID]

